<?php
class TeacherTag extends Zend_Db_Table{
    protected $_name ="teacher_tag";
	protected $_primary = 'id';

     //根据file_id 查询teachertag
    public function getteachertagByid($file_id){
          $select = $this->select();
          $select->where("id=".$file_id);
          return $this->fetchAll($select)->toArray();
    }

         //根据file_id 查询teachertag
    public function getteachertagByteacher_id($file_id){
          $select = $this->select();
          $select->where("teacher_id=".$file_id);
          return $this->fetchAll($select)->toArray();
    }

             //根据tag_id 查询teachertag
    public function getteachertagBytag_id($tag_id){
          $select = $this->select();
          $select->where("tag_id=".$tag_id);
          return $this->fetchAll($select)->toArray();
    }

    public function delteachertagByteacherid($teacher_id,$tag_id){
         $where = "teacher_id=".$teacher_id." and tag_id=".$tag_id;
         $this->delete($where);
         return true;
    }

 //更新teachertag
    public function updateteachertagByid($array,$file_id){

		$db = $this->getAdapter();
		$where=$db->quoteInto('id = ?', $file_id);
		$this->update($array, $where);
	}
//删除teachertag
     public function delteachertagByid($file_id){
          $where = 'id = '. $file_id;
         $this->delete($where);
         return true;
    }
}
?>
